<me:UIVKPOS
    x:Class="WPFExcelReport.TVKPYARN"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM" 
    xmlns:WD="clr-namespace:WPFExcelReport;assembly=TWDECK"
    xmlns:WG="clr-namespace:WPFExcelReport;assembly=TWGBST"
    xmlns:VA="clr-namespace:WPFExcelReport;assembly=TVAART" 
    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN" 
    xmlns:WFW="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"
    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    xmlns:ZB="clr-namespace:WPFExcelReport;assembly=TVKZUAB"  
    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
    xmlns:me="clr-namespace:WPFExcelReport"  
    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"  
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:PreisConverter  x:Key="price"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVKPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition  Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel  Grid.Row="0" Grid.Column="0" Visibility="Collapsed">
            <WrapPanel  Margin="10,0,0,0" VerticalAlignment="Top">
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" 
                      Visibility="{Binding IsCanAdd,ElementName=TV,Converter={StaticResource ResourceKey=bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" 
                      Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource ResourceKey=bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" 
                      Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource ResourceKey=bv}}">                 
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <WrapPanel IsEnabled="{Binding IsKEY}">
                    <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=行:}}"   Margin="0,0,0,0"></TextBlock>
                        <TextBlock Grid.Column="1"   Text="{Binding VKPAUFPOS,Source={StaticResource vwMaster}}" Width="30" />
                    </Grid>
                </WrapPanel>
                <Grid VerticalAlignment="Top" 
                        Visibility="{Binding IsCanAdd,ElementName=TV,Converter={StaticResource ResourceKey=bv}}"> 
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0"   Click="NewCommand">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid> 
            </WrapPanel>   
            <TXT:TXTITX Name="cTxt" SIND="{Binding TXTISIND,ElementName=TV}"  
                         TART="VKT"
                        IsEdit="{Binding IsEdit,ElementName=TV}" 
                    DEFTXT="{Binding DEFTXT,ElementName=TV}"  
                     Width="Auto" HorizontalAlignment="Left"/>
            <VF:TVA10 Name="cSVA10"  ORDERNUM="{Binding VART,ElementName=TV}"   />  
        </StackPanel>
        <Grid Grid.Row="0" Grid.RowSpan="2"  Grid.Column="0" Grid.ColumnSpan="2" >
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <Grid VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <VF:TSVA10 Name="cVA10" ARTST="{Binding ARTST,ElementName=TV}"
                           dwVF="{Binding dwVF,ElementName=TV}" 
                               IsEdit="True"
                           Width="Auto" MinWidth="200" />
                </Grid> 
            </StackPanel>
            <DataGrid Grid.Row="1"  
                AutoGenerateColumns="False"  EnableRowVirtualization="False"  
                      Name="dlgMaster"  IsReadOnly="True" 
                      ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True"
                      CanUserResizeRows="True"  
                   RowDetailsVisibilityMode="VisibleWhenSelected" 
                  Width="Auto" Height="Auto"
                  EnableColumnVirtualization="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="60"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS,Converter={StaticResource pnum}}" Header=" " Width="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=纱线}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                    <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}" Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPEXAUFKRS}" Header=" " Width="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPEXAUFLFD,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=复板单}}" Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=VKPEXAUFPOS,Converter={StaticResource pnum}}" Header="" Width="30"  />
                    <DataGridTextColumn Binding="{Binding Path=VKPAENDBEN}" Header="{Binding Source={Localization:Translate Word=更改}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPAENDDAT}" Header="{Binding Source={Localization:Translate Word=日期}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="{Binding Source={Localization:Translate Word=创建}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="{Binding Source={Localization:Translate Word=日期}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Grid>
</me:UIVKPOS>
